feat: WeakDataset catalog IO + reduced shear (weak series step 7a)#589
Merged
Conversation
Real-catalogue interface for the weak-lensing series (phase 7a of #588): - WeakDataset.from_arrays / to_csv / from_csv (columns name,y,x,gamma_2, gamma_1,noise[,redshift]) and from_fits (binary table, explicit column mapping, hdu select) — loaders default is_reduced=True since real catalogues measure ellipticities (reduced shear) - weights= alternative to noise_map on all loaders (sigma = w**-0.5) - Optional per-galaxy redshifts stored for provenance / future sigma_crit scaling (single-effective-source-plane remains the fit assumption) - Reduced shear g = gamma/(1-kappa): SimulatorShearYX(reduced=True) simulates it (convergence via the same Hessian dispatch), WeakDataset.is_reduced declares it, FitWeak computes the matching model quantity - 7 new tests: loader validation, csv/fits/json round trips, weights conversion, reduced round-trip + mislabel guard Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Real-catalogue interface for the weak-lensing series (phase 7a of #588):
WeakDataset.from_arrays/to_csv/from_csv/from_fits(FITS binary tables with explicit column mapping), inverse-varianceweights=(σ = w^(−1/2)), optional per-galaxy source-redshift storage, and end-to-end reduced shear —SimulatorShearYX(reduced=True)simulates g = γ/(1−κ),WeakDataset.is_reduceddeclares it,FitWeakcomputes the matching model quantity via the same Hessian primitive. Loaders defaultis_reduced=True(real catalogues measure ellipticities); the simulator defaults to plain γ, matching the earlier tutorials.API Changes
Added only — no existing symbol removed, renamed or changed;
WeakDataset.__init__gains optionalredshifts=/is_reduced=(defaults preserve existing behaviour and JSON round-trips).al.WeakDataset.from_arrays / to_csv / from_csv / from_fitsal.SimulatorShearYX(reduced=)See full details in the issue plan (feat: weak lensing real-data support — catalog IO, reduced shear, A2744 (weak series step 7) #588).
Test Plan
test_autolens/suite: 364 passed (48 weak, 7 new).Validation checklist (--auto run)
🤖 Generated with Claude Code